import 'package:json_annotation/json_annotation.dart';
part 'knowledge_model.g.dart';

/// 列表模型数组
class KnowledgeModelList {
  List<KnowledgeModel> list;
  KnowledgeModelList(this.list);
  factory KnowledgeModelList.fromJson(List<dynamic> list) {
    return KnowledgeModelList(
      list.map((item) => KnowledgeModel.fromJson(item)).toList(),
    );
  }
}

@JsonSerializable()
class KnowledgeModel {
  /// 收藏数
  int? collectsnum;
  /// id
  String? id;
  /// isjing
  int? isjing;
  /// 浏览数
  String? view_count;

  /// 图片高度
  String? cover_height;
  /// 图片宽度
  String? cover_width;
  /// 头像图片
  String? headicon;
  /// 图片
  String? image;
  /// 是否喜欢
  int? islike;
  /// 喜欢数量
  int? likenum;
  /// 文字描述
  String? name;
  /// 作者名字
  String? nickname;
  /// note_id
  String? note_id;
  /// id
  String? user_id;
  /// 视频id
  String? video_id;

  KnowledgeModel(this.collectsnum,this.id,this.isjing,this.view_count,this.cover_height,this.cover_width,this.headicon,this.image,
      this.islike,this.likenum,this.name,this.nickname,this.note_id,this.user_id,this.video_id,);
  factory KnowledgeModel.fromJson(Map<String,dynamic> json) => _$KnowledgeModelFromJson(json);
  Map<String, dynamic> toJson() => _$KnowledgeModelToJson(this);
}

